package com.yx.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Classname RedissonConfig
 * @Date 2021/07/10 10:12
 * @Author by yx
 * @Description : redisson配置
 */
@Configuration
public class RedissonConfig {

    @Bean
    public RedissonClient redissonClient(){
        Config config = new Config();
        config.useSingleServer()
                .setAddress("redis://192.168.136.110:6379")
                .setPassword("MyP@ssw0rd");

        RedissonClient redissonClient = Redisson.create(config);
        return redissonClient;
    }
}
